package cn.zf233.jwtshiro.exception;

import cn.zf233.jwtshiro.common.R;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Created by zf233 on 2020/11/4
 * 异常统一处理
 */
 @RestControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 权限不足
     */
    @ExceptionHandler(value = AuthorizationException.class)
    public R<String> doException() {
        return R.createByErrorMessage("权限不足");
    }
}
